The invention relates generally to data storage and, more particularly, to blocking techniques for data storage and run-time error recovery capability.
As organizations have embraced computer technology, the use of database management systems to store, organize, and manipulate information has increased rapidly. As used herein, a database management system is a computerized record-keeping system to manage one or more databases. A database may be defined as a collection of shared operational data stored on one or more storage units. Illustrative storage units include, but are not limited to, magnetic and optical disk units.
Referring to FIG. 1, operational data 100 may include data element 102 and index element 104. Data element 102 represents a collection of data organized into records (e.g., record 106). Each record, in turn, may include one or more fields (e.g., fields F1 through F5). For example, record 106 may represent an employee record whose fields are defined in Table 1 below. Index element 104 represents a collection of one or more keys, each of which identifies a unique record or data field (e.g., employee number 108) in data element 102.
Typically, records (e.g., record 106) accommodate variable size data in one of two ways. First, the size of each field within a record may be fixed to allow for the maximum expected entry. Alternatively, the size of individual fields may be allowed to vary from record to record. Using the first method, storage space may be wasted by those records whose entries do not use all of the specified storage. Using the second method, the complexity of storage, retrieval, backup, and error correction operations may be increased. For example, storage of variable size records makes it impractical determine a priori where a record may be stored on physical media. Thus, prefetch techniques (which bring data into main memory before it is actually processed) applied to variable length records may provide little, if any, improved access speed.
For example, if one or more fields within a record (e.g., record 106) becomes damaged (corrupted) during database operations, the damaged field(s) may be restored from backup media. If one or more records within index element 104 becomes corrupted, the index may be rebuilt using the relevant records and field data in data element 102. Both data backup and index reconstruction operations may be computationally and time intensive tasks (especially for large databases) that either limit or prevent access to data 102 and/or indexes 104 during their operation.
Thus, it would be beneficial to provide techniques to improve the storage, retrieval, and error correction capability of database operational data.
In one embodiment the invention provides a method to store data in a memory. The method includes storing a first data structure in a memory, the first data structure including only zero or more fixed-length data items and a reference to a second data structure. The method further including storing the second data structure in the memory, the second data structure including a variable-length data item indicated by the reference. In another embodiment of the invention, the invention comprises the data structures used by the described method. In yet another embodiment, the method may be stored in any media that is readable and executable by a programmable control device.
In still further embodiments, methods to validate and repair a pointer element having a file identification portion and a file offset portion are described. The methods include determining if the file identification portion indicates an allocated file and indicating an invalid pointer condition if the file identification portion indicates an unallocated file, else determining if the file offset portion indicates an allocated block in the allocated file, and indicating an invalid pointer condition if the file offset portion indicates an unallocated block. The described pointer validation and/or repair methods may be stored in any media that is readable and executable by a programmable control device.